Repository navigation
perf: cut server, database, relay, and web hot-path overhead - #1095
Merged
Merged
Conversation
High-rate streaming deltas, session sweeps, and projection writes were triggering redundant SQLite reads, full-row JSON rewrites, and repeated full read-model hydrations on the main thread. - Return early in ProviderService.listSessions when no adapters are active and fetch bindings only for active session thread IDs. - Route content.delta runtime ingestion through a narrow active-thread lookup (session and live side-turns) instead of four-query shell hydration with diff-stat rollups. - Update only updated_at in ProjectionPipeline for assistant messages and activities, guard subagent roster reads behind activityMayAffectSubagents, skip streaming session lookups and no-op turn upserts, and drop redundant correlated subqueries from message upserts. - Guard Claude partial tool JSON decoding with outer-brace checks, enforce the 500 ms file-change estimate throttle before scanning, and scan partial JSON strings in linear-time slices. - Scope shell snapshot diff-stat rollups to active or archived threads and replace non-engine getCommandReadModel calls in ProjectSetupSource, LinkMoves, and single-thread ThreadMoves paths. - Drop six unused or prefix-redundant SQLite indexes in migration 126 and tune NodeSqliteClient with a 1024-entry statement cache, borrower-based statement execution, prepared transaction controls, and savepoint release. - Wake AssistantEvents discovery only on events that produce assistant actions, and nudge discovery on stale settlements.
Streaming turns and composer typing triggered redundant markdown parses, full-thread UI syncs, duplicated inbox derivations, and broad store re-renders in the web client, while the desktop app serialized shell probing ahead of startup, rasterized all 38 macOS tray icons upfront, and kept preview browser CDP buffers and accessibility active. Stabilize markdown link-kind state, cache per-block file-path scans, narrow backdrop observers on active chat threads, deduplicate thread shells structurally on modelSelection, switch thread upserts to single-thread UI sync, share one inbox derivation with narrower component selectors, overlap desktop shell probing with startup, rasterize macOS tray frames lazily on first use, and disable unused preview CDP response buffering and eager accessibility tracking.
…s async Reduces checkpoint git overhead, WebSocket fanout work, retained evicted thread memory, idle reveal animation frames, and blocking main-thread log and cache writes. - Coordinate pre-turn checkpoints across ProviderCommandReactor and CheckpointReactor, shard checkpoint work across threads with per-checkout revert serialization, and cache stable git lookups in scratchIndex. - Share one coalesced shell stream producer across WebSocket clients, bound shell and thread subscriber queues with clean resync on overflow, and return only the sequence on event store appends. - Release evicted thread detail slices and derivation caches while pausing idle eviction offline and preserving pending scroll anchors and worktree locks. - Create streaming text reveal observers lazily, stop idle animation frames when caught up, and advance only the live reveal tail. - Move rotating trace and provider logs to fs.promises with per-path rotation locks and shutdown flush, batch desktop child logs, optimize terminal ANSI scans and output bursts, compact usage rate caches, and debounce usage scan cache writes.
Reduces background polling, process spawns, memory retention, and hot-path work across server, web, desktop, shared, and client-runtime without changing user-visible behavior. - Relay: pass fixed ArrayBuffer views directly to WebCrypto, build header-prefixed records in one allocation, and avoid double-copying single-part frames. - Providers: slow disabled provider scheduled refreshes by 6x, cap refreshAll concurrency to 3, cache scheduled Claude token usage within the same UTC day, and cache claude --version by resolved executable stat metadata. - Git and workspace: skip numstat diffs on clean status checks, reuse status GitConfigSnapshot in GitManager, cap background remote refreshes to 4 with post-permit re-checks, and filter ignored tracked files via git ls-files --cached --ignored. - Pull requests: raise viewer and repository cache capacities to 64, run authored searches in parallel with workspace listings, share worktree listings per sweep with fresh revalidation before auto-merge, and back off confirmed missing worktrees. - Server and client cleanups: cache ProjectFaviconResolver lookups, stop retaining raw SDK messages in ClaudeAdapter turnState.items, tag OpenCode and ACP streaming chunks as stream fragments, cache compiled search regexes, track MJPEG scan cursors, replace Equal.equals on work rows, skip redundant activity sorts, lazy-load DiffWorkerPoolProvider, pause the desktop backdrop CPU watchdog when art is still or hidden, and cache mainFrameId in PreviewAutomation.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Wait for RotatingFileSink.writeAsync to settle and for the flush fiber to reschedule before advancing TestClock in packages/shared/src/observability.test.ts, preventing the CI timeout race when async fs.promises calls finish after the test probe triggers. Group initial vendor and shared startup modules in apps/web/vite.config.ts using $initial and entriesAware rules so startup drops from 96 JS files to 8 files and stays 30 KB under the 915 KB gzip budget.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
High-frequency streaming, background polling, SQLite projection writes, and retained web store state accumulated main-thread stalls, redundant git and CLI spawns, and steady memory growth across long sessions.
Changes
aee8bc705): route streamingcontent.deltaevents through a narrowgetThreadIngestionContextquery instead of 4-querygetThreadShellById, update onlyupdated_aton streaming assistant deltas, skip directory scans inProviderService.listSessions()when no sessions are active, drop redundant SQLite indexes in migration 126, narrow move/setup/assistant-event queries, and scan Claude partial tool JSON incrementally.e6d177125): cache per-block markdown file-link scans so settled blocks keep stable memo keys while streaming, stabilize empty file-link maps and timeline work rows withoutEqual.equals, avoid unnecessarytoSortedcopies on in-place activity upserts, narrow sidebar and inbox store subscriptions, throttle desktop CDP previews and status indicator redraws, and move desktop tray/icon setup off startup.d77f0e446): hand off pre-turn checkpoints betweenProviderCommandReactorandCheckpointReactor, shard checkpoint capture per thread, share one coalesced shell stream producer across WebSocket clients with bounded queues, release evicted thread detail slices and derivation caches in the web store, create streaming reveal observers lazily with zero idle animation frames, and move rotating log sinks and usage cache writes tofs.promises.f55adc23e): remove redundant buffer copies inrelaySecure.ts, slow polling 6x for disabled providers, cache Claude version lookups and project favicon probes, cut git status spawns (5 to 3 on clean repos, 5 to 4 local and 10 to 9 remote on dirty repos), make the device MJPEG parser and search ranker linear time, and moveDiffWorkerPoolProviderto a dynamic import.Benchmark highlights (main
7d1a878cdvsf55adc23e)ProviderService.listSessions(20 calls, 900 rows)Verification
vp fmt,vp lint, andvp run typecheckpass across all packages.